package it.xiuxian.personcenter.presenter

import com.lzy.okgo.OkGo

import it.xiuxian.lib.base.BaseBean
import it.xiuxian.lib.base.BasePresenter
import it.xiuxian.lib.base.ILoadBind
import it.xiuxian.lib.http.CallBackOption
import it.xiuxian.lib.http.HttpConfig
import it.xiuxian.lib.utils.EncodeUtils
import it.xiuxian.lib.utils.ToastUtil
import it.xiuxian.personcenter.activity.MyTeamActivity
import it.xiuxian.personcenter.bean.MyTeamBean

import org.json.JSONObject


class MyTeamActivityPresenter:BasePresenter<MyTeamActivity>() {
    fun getTeam(pageNo:String){
        var json1 = JSONObject()
        json1.put("pageNo",pageNo)
        OkGo.post<BaseBean<MyTeamBean>>(HttpConfig.BASE_URL+"/apptuiguang/list")
            .params("encrypt", EncodeUtils.encodeAES(json1.toString()))
            .execute(object : CallBackOption<BaseBean<MyTeamBean>>() {}.loadBind(mView as MyTeamActivity).execute(
                object : ILoadBind<BaseBean<MyTeamBean>> {
                    override fun excute(bean: BaseBean<MyTeamBean>) {
                        if(bean.code==0){
                            (mView as MyTeamActivity).setData(bean.data)

                        }
                    }
                }
            ))
    }
}